<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'base.item.class.php');

class MemberStatusLiveItemBase extends BaseItemBase {
	var $_id = 0;
	var $_item = array();
	
	//constructor
	function MemberStatusLiveItemBase() {
		parent::BaseItemBase();
		
		$this->_table_owner_field = 'uid';
		$this->table = 'pp_m_students_status_live_items';
		$this->prefix = 's_';
		
		$this->sort_fields = array('id+');
	}
	
	//current
	function bind($owner = 0) {
		if( $owner == 0 ) {
			$this->owner = $this->_get_current_user();
		} else {
			$this->owner = $owner;
		}
		$item = $this->getItemBy($this->owner, $this->_table_owner_field);
		if( $item['id'] > 0 ) {
			$this->_id = $item['id'];
			$this->_item = $item;
		}
	}
	
	function checkExist() {
		return (($this->_id > 0) ? true : false);
	}
	
	function get_ID() {
		return $this->_id;
	}
	
	function get_Item() {
		return $this->_item;
	}
	
	//methods
	function onAddItemBefore($data_array) {
		return false;
	}
	
	function onUpdateItemBefore($items_id, $data_array) {
		return false;
	}
}
//
?>